<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>
<body>
  <div id="app"></div>
  <!-- 1.引入js文件 -->
  <script src="https://cdn.staticfile.org/react/16.4.0/umd/react.development.js"></script>
  <script src="https://cdn.staticfile.org/react-dom/16.4.0/umd/react-dom.development.js"></script>
  <script src="https://cdn.staticfile.org/babel-standalone/6.26.0/babel.min.js"></script>
  <script type="text/babel">
    class App extends React.Component {
      constructor(props) {
        super(props);
        this.state = {
          numbers: [10, 30, 120, 453, 55, 78, 111, 222]
        }
      }
      render() {
        return (
          <div>
            <h2>数字列表</h2>
            <h3>获取所有大于50的数字，并且展示前3个数字</h3>
            <ul>
              {
                this.state.numbers.filter(item => item>=50).slice(0,3).map(item => {
                  return <li>{item}</li>
                })
              }
            </ul>
          </div>
        )
      }

    }

    ReactDOM.render(<App/>, document.getElementById("app"));
  </script>
</body>
</html>